package com.tangruojie;

import com.tangruojie.service.BookService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AppForName {

    public static void main(String[] args) {

        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");

        /**
         * Bean的别名
         */
        BookService bookService = (BookService) applicationContext.getBean("service1");

        bookService.save();

    }

}
